package org.lex.collection.tree;

import org.lex.utils.Range;

public class TreeNodeRangeAdapter implements Range<Object> {
	private final ITreeNode node;

	public TreeNodeRangeAdapter(ITreeNode node) {
		this.node = node;
	}

	@Override
	public int startPosition() {
		return 0;
	}

	@Override
	public int endPosition() {
		return node.getChildCount();
	}

	@Override
	public Object getValue(int index) {
		return node.getChild(index).getData();
	}
}
